home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DELPHI / CC32.ZIP / CLOCK.CD next >
Encoding:
INI File  |  1996-03-15  |  9.4 KB  |  599 lines

  1. [MainInfo$]
  2. CCVer=2.1
  3. Compatible20=0
  4. Compatible21=1
  5. UnitName=Clocklbl
  6. NewClassName=TClockLabel
  7. ParentClassName=TCustomLabel
  8. DefaultPalette=Samples
  9. CopyrightLine=A public domain component
  10. FormMode=0
  11. FormFile=
  12.  
  13. [Units$]
  14. Lines=10
  15. L1=Classes
  16. L2=Controls
  17. L3=ExtCtrls
  18. L4=Forms
  19. L5=Graphics
  20. L6=Messages
  21. L7=Stdctrls
  22. L8=SysUtils
  23. L9=WinProcs
  24. L10=WinTypes
  25.  
  26. [ItemList$]
  27. Create=Method
  28. Destroy=Method
  29. Paint=Method
  30. OnClick=ExistingEvent
  31. OnDblClick=ExistingEvent
  32. OnDragDrop=ExistingEvent
  33. OnDragOver=ExistingEvent
  34. OnEndDrag=ExistingEvent
  35. OnMouseDown=ExistingEvent
  36. OnMouseMove=ExistingEvent
  37. OnMouseUp=ExistingEvent
  38. ShowDate=Property
  39. ShowTime=Property
  40. DateStr=Property
  41. TimeStr=Property
  42. TimeSep=Property
  43. DateFmtUSA=Property
  44. TimeFmt24hr=Property
  45. Font=Property
  46. Visible=Property
  47. NewCaption=Method
  48. Update=Method
  49. Timer=Variable
  50.  
  51. [Global$]
  52. Descr=Label to display date and current time of day
  53. DefaultCode=1
  54.  
  55. [Code$]
  56. Lines=0
  57.  
  58. [Help$]
  59. Lines=0
  60.  
  61. [Create]
  62. Descr=
  63. DefaultCode=2
  64. Kind=2
  65. Header=Create(AOwner: TComponent)
  66. S=0
  67. Ov=1
  68. Mode=2
  69. WinMessage=
  70.  
  71. [CreateCode$]
  72. Lines=12
  73. L1=begin
  74. L2=~~~~~{ Call the Create method of the parent class }
  75. L3=~~~~~inherited Create(AOwner);
  76. L4=
  77. L5=~~~~~{ Set the initial values of variables and properties and }
  78. L6=~~~~~{ create object for Timer variable. }
  79. L7=~~~~~{ AutoInitialize procedure is generated by Component Create. }
  80. L8=~~~~~AutoInitialize;
  81. L9=
  82. L10=~~~~~{ Start timer }
  83. L11=~~~~~Timer.Enabled := True
  84. L12=end;
  85.  
  86. [CreateHelp$]
  87. Lines=0
  88.  
  89. [Destroy]
  90. Descr=
  91. DefaultCode=4
  92. Kind=3
  93. Header=Destroy
  94. S=0
  95. Ov=1
  96. Mode=2
  97. WinMessage=
  98.  
  99. [DestroyCode$]
  100. Lines=9
  101. L1=begin
  102. L2=~~~~~{ AutoDestroy, which is generated by Component Create, frees any   }
  103. L3=~~~~~{ objects created by AutoInitialize.                               }
  104. L4=~~~~~AutoDestroy;
  105. L5=
  106. L6=~~~~~{ Free the component by calling the Destroy method of the          }
  107. L7=~~~~~{ parent class.                                                    }
  108. L8=~~~~~inherited Destroy;
  109. L9=end;
  110.  
  111. [DestroyHelp$]
  112. Lines=0
  113.  
  114. [Paint]
  115. Descr=
  116. DefaultCode=5
  117. Kind=0
  118. Header=Paint
  119. S=1
  120. Ov=1
  121. Mode=2
  122. WinMessage=
  123.  
  124. [PaintCode$]
  125. Lines=7
  126. L1=begin
  127. L2=~~~~~{ Update the caption of the label with the current date
  128. L3=~~~~~~~and time string, then call the Paint method of the
  129. L4=~~~~~~~parent class to re-draw }
  130. L5=~~~~~Caption := NewCaption;
  131. L6=~~~~~inherited Paint;
  132. L7=end;
  133.  
  134. [PaintHelp$]
  135. Lines=0
  136.  
  137. [OnClick]
  138. Descr=
  139. DefaultCode=7
  140. Ov=0
  141. P=0
  142. HandlerDecl=Click
  143.  
  144. [OnClickCode$]
  145. Lines=0
  146.  
  147. [OnClickHelp$]
  148. Lines=0
  149.  
  150. [OnDblClick]
  151. Descr=
  152. DefaultCode=8
  153. Ov=0
  154. P=0
  155. HandlerDecl=DblClick
  156.  
  157. [OnDblClickCode$]
  158. Lines=0
  159.  
  160. [OnDblClickHelp$]
  161. Lines=0
  162.  
  163. [OnDragDrop]
  164. Descr=
  165. DefaultCode=13
  166. Ov=0
  167. P=0
  168. HandlerDecl=DragDrop(DragObject: TObject; X, Y: Integer)
  169.  
  170. [OnDragDropCode$]
  171. Lines=0
  172.  
  173. [OnDragDropHelp$]
  174. Lines=0
  175.  
  176. [OnDragOver]
  177. Descr=
  178. DefaultCode=0
  179. Ov=0
  180. P=0
  181. HandlerDecl=
  182.  
  183. [OnDragOverCode$]
  184. Lines=0
  185.  
  186. [OnDragOverHelp$]
  187. Lines=0
  188.  
  189. [OnEndDrag]
  190. Descr=
  191. DefaultCode=13
  192. Ov=0
  193. P=0
  194. HandlerDecl=
  195.  
  196. [OnEndDragCode$]
  197. Lines=0
  198.  
  199. [OnEndDragHelp$]
  200. Lines=0
  201.  
  202. [OnMouseDown]
  203. Descr=
  204. DefaultCode=13
  205. Ov=0
  206. P=0
  207. HandlerDecl=MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer)
  208.  
  209. [OnMouseDownCode$]
  210. Lines=0
  211.  
  212. [OnMouseDownHelp$]
  213. Lines=0
  214.  
  215. [OnMouseMove]
  216. Descr=
  217. DefaultCode=13
  218. Ov=0
  219. P=0
  220. HandlerDecl=MouseMove(Shift: TShiftState; X, Y: Integer)
  221.  
  222. [OnMouseMoveCode$]
  223. Lines=0
  224.  
  225. [OnMouseMoveHelp$]
  226. Lines=0
  227.  
  228. [OnMouseUp]
  229. Descr=
  230. DefaultCode=13
  231. Ov=0
  232. P=0
  233. HandlerDecl=MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer)
  234.  
  235. [OnMouseUpCode$]
  236. Lines=0
  237.  
  238. [OnMouseUpHelp$]
  239. Lines=0
  240.  
  241. [ShowDate]
  242. Descr=Include date in display?
  243. DefaultCode=6
  244. IN=0
  245. RO=0
  246. PropType=Boolean
  247. PropDefault=True
  248. Quote=0
  249. RM=0
  250. WM=1
  251. Hide=0
  252. DefEdit=1
  253. All=0
  254. EC=
  255. EU=
  256. Link=
  257.  
  258. [ShowDateCode$]
  259. Lines=5
  260. L1=begin
  261. L2=~~~~~FShowDate := Value;
  262. L3=~~~~~{ Changing this value changes the display, so ... }
  263. L4=~~~~~Invalidate;
  264. L5=end;
  265.  
  266. [ShowDateHelp$]
  267. Lines=0
  268.  
  269. [ShowTime]
  270. Descr=Include time in display?
  271. DefaultCode=6
  272. IN=0
  273. RO=0
  274. PropType=Boolean
  275. PropDefault=True
  276. Quote=0
  277. RM=0
  278. WM=1
  279. Hide=0
  280. DefEdit=1
  281. All=0
  282. EC=
  283. EU=
  284. Link=
  285.  
  286. [ShowTimeCode$]
  287. Lines=5
  288. L1=begin
  289. L2=~~~~~FShowTime := Value;
  290. L3=~~~~~{ Changing this value changes the display, so ... }
  291. L4=~~~~~Invalidate;
  292. L5=end;
  293.  
  294. [ShowTimeHelp$]
  295. Lines=0
  296.  
  297. [DateStr]
  298. Descr=Current date
  299. DefaultCode=6
  300. IN=0
  301. RO=1
  302. PropType=String
  303. PropDefault=
  304. Quote=0
  305. RM=1
  306. WM=0
  307. Hide=0
  308. DefEdit=1
  309. All=0
  310. EC=
  311. EU=
  312. Link=
  313.  
  314. [DateStrCode$]
  315. Lines=0
  316.  
  317. [DateStrReadCode$]
  318. Lines=18
  319. L1=const
  320. L2=~~~~~Months : array[1..12] of String[10] =
  321. L3=~~~~~~~~~~~~~~('January','February','March','April','May','June',
  322. L4=~~~~~~~~~~~~~~'July','August','September','October','November','December');
  323. L5=~var
  324. L6=~~~~~Year, Month, Day, Weekday : Word;
  325. L7=~~~~~DayStr, YearStr : String[10];
  326. L8=begin
  327. L9=~~~~~(*  Obtain the date information  *)
  328. L10=~~~~~DecodeDate(Now, Year, Month, Day);
  329. L11=~~~~~Str(Day, DayStr);
  330. L12=~~~~~Str(Year, YearStr);
  331. L13=~~~~~if FDateFmtUSA then
  332. L14=~~~~~~~~~~FDateStr := Months[Month] + ' ' + DayStr + ', ' + YearStr
  333. L15=~~~~~else
  334. L16=~~~~~~~~~~FDateStr := DayStr + ' ' + Months[Month] + ' ' + YearStr;
  335. L17=~~~~~GetDateStr := FDateStr
  336. L18=end;
  337.  
  338. [DateStrHelp$]
  339. Lines=0
  340.  
  341. [TimeStr]
  342. Descr=Current time
  343. DefaultCode=6
  344. IN=0
  345. RO=1
  346. PropType=String
  347. PropDefault=
  348. Quote=0
  349. RM=1
  350. WM=0
  351. Hide=0
  352. DefEdit=1
  353. All=0
  354. EC=
  355. EU=
  356. Link=
  357.  
  358. [TimeStrCode$]
  359. Lines=0
  360.  
  361. [TimeStrReadCode$]
  362. Lines=26
  363. L1=~var
  364. L2=~~~~~Hour, Minute, Seconds, Hundreds : Word;
  365. L3=~~~~~HourStr, MinuteStr, AmPm : String[10];
  366. L4=begin
  367. L5=~~~~~(*  Obtain the time information  *)
  368. L6=~~~~~DecodeTime(Now, Hour, Minute, Seconds, Hundreds);
  369. L7=~~~~~(*  Take account of 12-hour time, if necessary  *)
  370. L8=~~~~~if FTimeFmt24hr then
  371. L9=~~~~~~~~~~AmPm := ''
  372. L10=~~~~~else
  373. L11=~~~~~~~~~~if Hour > 12 then
  374. L12=~~~~~~~~~~~~~~~begin
  375. L13=~~~~~~~~~~~~~~~Hour := Hour - 12;
  376. L14=~~~~~~~~~~~~~~~AmPm := ' pm'
  377. L15=~~~~~~~~~~~~~~~end
  378. L16=~~~~~~~~~~else
  379. L17=~~~~~~~~~~~~~~~AmPm := ' am';
  380. L18=~~~~~(*  Convert the time values to strings  *)
  381. L19=~~~~~Str(Hour, HourStr);
  382. L20=~~~~~Str(Minute, MinuteStr);
  383. L21=~~~~~(*  Add leading zero if Minute is one digit  *)
  384. L22=~~~~~if Minute < 10 then
  385. L23=~~~~~~~~~~MinuteStr := '0' + MinuteStr;
  386. L24=~~~~~FTimeStr := HourStr + FTimeSep + MinuteStr + AmPm;
  387. L25=~~~~~GetTimeStr := FTimeStr
  388. L26=end;
  389.  
  390. [TimeStrHelp$]
  391. Lines=0
  392.  
  393. [TimeSep]
  394. Descr=Field separator for time string
  395. DefaultCode=6
  396. IN=0
  397. RO=0
  398. PropType=String
  399. PropDefault=':'
  400. Quote=1
  401. RM=0
  402. WM=1
  403. Hide=0
  404. DefEdit=1
  405. All=0
  406. EC=
  407. EU=
  408. Link=
  409.  
  410. [TimeSepCode$]
  411. Lines=5
  412. L1=begin
  413. L2=~~~~~FTimeSep := Value;
  414. L3=~~~~~{ Changing this value changes the display, so ... }
  415. L4=~~~~~Invalidate;
  416. L5=end;
  417.  
  418. [TimeSepHelp$]
  419. Lines=0
  420.  
  421. [DateFmtUSA]
  422. Descr=Use U.S. format for date (mm dd, yy)?
  423. DefaultCode=6
  424. IN=0
  425. RO=0
  426. PropType=Boolean
  427. PropDefault=True
  428. Quote=0
  429. RM=0
  430. WM=1
  431. Hide=0
  432. DefEdit=1
  433. All=0
  434. EC=
  435. EU=
  436. Link=
  437.  
  438. [DateFmtUSACode$]
  439. Lines=6
  440. L1=begin
  441. L2=~~~~~FDateFmtUSA := Value;
  442. L3=~~~~~{ Changing this property affects the appearance of
  443. L4=~~~~~~~the component, so ... }
  444. L5=~~~~~Invalidate;
  445. L6=end;
  446.  
  447. [DateFmtUSAHelp$]
  448. Lines=0
  449.  
  450. [TimeFmt24hr]
  451. Descr=Display 24-hour time or 12-hour?
  452. DefaultCode=6
  453. IN=0
  454. RO=0
  455. PropType=Boolean
  456. PropDefault=False
  457. Quote=0
  458. RM=0
  459. WM=1
  460. Hide=0
  461. DefEdit=1
  462. All=0
  463. EC=
  464. EU=
  465. Link=
  466.  
  467. [TimeFmt24hrCode$]
  468. Lines=4
  469. L1=begin
  470. L2=~~~~~FTimeFmt24hr := Value;
  471. L3=~~~~~Invalidate
  472. L4=end;
  473.  
  474. [TimeFmt24hrHelp$]
  475. Lines=0
  476.  
  477. [Font]
  478. Descr=Publish Font property of parent class
  479. DefaultCode=6
  480. IN=1
  481. RO=0
  482. PropType=TFont
  483. PropDefault=
  484. Quote=0
  485. RM=0
  486. WM=0
  487. Hide=0
  488. DefEdit=1
  489. All=0
  490. EC=
  491. EU=
  492. Link=
  493.  
  494. [FontCode$]
  495. Lines=0
  496.  
  497. [FontHelp$]
  498. Lines=0
  499.  
  500. [Visible]
  501. Descr=Publish Visible property of parent class
  502. DefaultCode=6
  503. IN=1
  504. RO=0
  505. PropType=Boolean
  506. PropDefault=True
  507. Quote=0
  508. RM=0
  509. WM=0
  510. Hide=0
  511. DefEdit=1
  512. All=0
  513. EC=
  514. EU=
  515. Link=
  516.  
  517. [VisibleCode$]
  518. Lines=0
  519.  
  520. [VisibleHelp$]
  521. Lines=0
  522.  
  523. [NewCaption]
  524. Descr=Returns updated time and date string
  525. DefaultCode=0
  526. Kind=1
  527. Header=NewCaption : String
  528. S=2
  529. Ov=0
  530. Mode=2
  531. WinMessage=
  532.  
  533. [NewCaptionCode$]
  534. Lines=13
  535. L1=var
  536. L2=~~~~~DisplayLine : String;
  537. L3=begin
  538. L4=~~~~~if FShowDate then
  539. L5=~~~~~~~~~~DisplayLine := GetDateStr
  540. L6=~~~~~else
  541. L7=~~~~~~~~~~DisplayLine := '';
  542. L8=~~~~~if FShowDate and FShowTime then
  543. L9=~~~~~~~~~~DisplayLine := DisplayLine + '  ';
  544. L10=~~~~~if FShowTime then
  545. L11=~~~~~~~~~~DisplayLine := DisplayLine + GetTimeStr;
  546. L12=~~~~~NewCaption := DisplayLine
  547. L13=end;
  548.  
  549. [NewCaptionHelp$]
  550. Lines=0
  551.  
  552. [Update]
  553. Descr=Forces update to label; triggered by Timer's OnTimer events
  554. DefaultCode=0
  555. Kind=0
  556. Header=Update(Sender : TObject)
  557. S=2
  558. Ov=0
  559. Mode=2
  560. WinMessage=
  561.  
  562. [UpdateCode$]
  563. Lines=10
  564. L1={ The component calls Update method periodically to keep
  565. L2=~~the time display current.  Update has been declared with
  566. L3=~~one argument of type TObject so it can be assigned as the
  567. L4=~~OnTimer event handler for variable Timer. }
  568. L5=
  569. L6=begin
  570. L7=~~~~~{ Has the time and date display changed?  If so, re-draw }
  571. L8=~~~~~if NewCaption <> Caption then
  572. L9=~~~~~~~~Invalidate
  573. L10=end;
  574.  
  575. [UpdateHelp$]
  576. Lines=0
  577.  
  578. [Timer]
  579. Descr=Internal timer for updating time display
  580. DefaultCode=17
  581. DataType=TTimer
  582. Default=
  583. Quote=0
  584. Sc=10
  585. IsObject=1
  586. IsSubComponent=1
  587.  
  588. [TimerCode$]
  589. Lines=6
  590. L1=begin
  591. L2={ Trigger OnTimer events every 30 seconds }
  592. L3=Interval := 30000;
  593. L4={ OnTimer events will generate call to Update procedure }
  594. L5=OnTimer := Update;
  595. L6=end;
  596.  
  597. [TimerHelp$]
  598. Lines=0
  599.